using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Zosnn.Models.Mapping
{
    public class SellerMap : EntityTypeConfiguration<Seller>
    {
        public SellerMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(200);

            this.Property(t => t.Address)
                .HasMaxLength(200);

            this.Property(t => t.Tel)
                .HasMaxLength(50);

            this.Property(t => t.Created)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.LoginName)
                .HasMaxLength(200);

            this.Property(t => t.Password)
                .HasMaxLength(50);

            this.Property(t => t.Contacts)
                .HasMaxLength(50);

            this.Property(t => t.GPSInfo)
                .HasMaxLength(500);

            this.Property(t => t.Around)
                .HasMaxLength(200);

            this.Property(t => t.Star)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Seller");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.Tel).HasColumnName("Tel");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.AreaID).HasColumnName("AreaID");
            this.Property(t => t.Created).HasColumnName("Created");
            this.Property(t => t.LoginName).HasColumnName("LoginName");
            this.Property(t => t.Password).HasColumnName("Password");
            this.Property(t => t.Contacts).HasColumnName("Contacts");
            this.Property(t => t.GPSInfo).HasColumnName("GPSInfo");
            this.Property(t => t.Around).HasColumnName("Around");
            this.Property(t => t.Star).HasColumnName("Star");
        }
    }
}
